<template>
	<view>
		<view class="tab-fixed u-p-20 u-flex u-row-around u-col-center">
			<view class="tab-item u-flex u-row-center u-col-center u-m-r-40" :class="is_choose==0?'active':''" @click="ontab(0)">代理与经销</view>
			<view class="tab-item u-flex u-row-center u-col-center" :class="is_choose==1?'active':''" @click="ontab(1)">经纪人</view>
		</view>
		<view v-if="is_choose==0" class="content">
			<shopro-project-item :myData="myDailiData" @goodsdetail="goodsdetail"></shopro-project-item>
			<view class="group-fac u-flex u-row-center u-col-center">
				<view class="content_box" v-if="myDailiData.desc"><u-parse :html="myDailiData.desc"></u-parse></view>
				<!-- 缺省页 -->
				<shopro-empty v-if="myDailiData.length==0" :image="$IMG_URL + '/imgs/empty/empty_goods.png'" tipText="暂无该内容~"></shopro-empty>
			
			</view>
		</view>
		<view v-if="is_choose==1" class="content u-p-l-20 u-p-r-20">
			<view class="group-fac moreContent" style="padding:30rpx 0">
<!--				<view class="content_box" v-if="myJingjiData.desc"><u-parse :html="myJingjiData.desc"></u-parse></view>-->
				<shopro-teacher-item :myData="myJingjiData"  @handleDetail="handleDetail"></shopro-teacher-item>
				<!-- 缺省页 -->
				<shopro-empty v-if="myJingjiData.length==0" :image="$IMG_URL + '/imgs/empty/empty_goods.png'" tipText="暂无该内容~"></shopro-empty>
			
			</view>
		</view>
<!--		<view class="bottom-group" v-if="is_choose==0">-->
<!--			<view class="bottom-btn u-flex u-flex-col u-row-center u-col-center"@click="jumpTo(vipData.viplist[1])">-->
<!--				<view class="btn-title">成为{{vipData.viplist[1].name}}</view>-->
<!--				<view class="btn-price u-m-t-6">¥{{ vipData.viplist[1].price?vipData.viplist[1].price:'' }}/年</view>-->
<!--			</view>-->
<!--			<view class="bottom-btn u-flex u-flex-col u-row-center u-col-center" @click="jumpTo(vipData.viplist[0])">-->
<!--				<view class="btn-title">成为{{vipData.viplist[0].name}}</view>-->
<!--				<view class="btn-price u-m-t-6">¥{{ vipData.viplist[0].price?vipData.viplist[0].price:'' }}/年</view>-->
<!--			</view>-->
<!--		</view>-->
<!--		<view class="bottom-group" v-if="is_choose==1">-->
<!--			<view class="bottom-btns u-flex u-flex-col u-row-center u-col-center">-->
<!--				<view class="btn-title">续费</view>-->
<!--			</view>-->
<!--		</view>-->
	</view>

</template>

<script>
export default {
	data() {
		return {
			is_choose:0,
			is_yige:0,
			content:'',
			myDailiData:[],
			myJingjiData:[],
			vipData:{}
		};
	},
	onLoad(){
		this.getMydaili();
		this.getViplist();
	},
	methods:{
		jump(path, parmas) {
			this.$Router.push({
				path: path,
				query: parmas
			});
		},
		ontab(index){
			this.is_choose = index;
			this.getMydaili();
		},
		ontabs(index){
			this.is_yige = index
		},
		getMydaili(){
			let url = "";
			if(this.is_choose == '1'){
				url = 'newuser.mydaili_myteach'
			}
			if(this.is_choose == '0'){
				url = 'newuser.mydaili_dailipro'
			}
			this.$new_http(url, {}).then((res) => {
				console.log(res.data.data);
				if(this.is_choose == '0'){
					this.myDailiData = res.data.data;
				}
				if(this.is_choose == '1'){
					this.myJingjiData = res.data.data;
				}
			});
		},
		getViplist() {
			let formData = {
				token: uni.getStorageSync('token')
			};
			this.$new_http('newuser.viplist',formData).then(res => {
				res.data.forEach((item)=>{
					if(item.name=='城市代理'){
						this.vipData =  item;
					}
				})

			});
			
		},
		jumpTo(item){
			uni.setStorageSync('order', item);
			this.jump('/pages/index/project_list/qrorder')
		},
		handleDetail(val) {
			console.log(val);
			uni.navigateTo({
				url: "/pages/finance/teacherDetail?val=" + val.id,
			});
			
		},
		goodsdetail(e) {
			uni.navigateTo({
				url: "/pages/index/project_list/detail?id=" + e.project_id,
			});
		},
	}
}
</script>

<style lang="scss">
page{
	background: #FBFAFA;
	font-size: 26rpx;
}
.tab-fixed{
	position: fixed;
	top: 0px;
	width: 100%;
	padding-top: 10px!important;
	padding-bottom: 10px!important;
	background:#FBFAFA;
	z-index: 1000;
	.tab-item{
		width: 33%;
		position:relative;
		//font-size: 32rpx;
		&.active{
			color: #ED861F;
		}
		&.active::after{
			content: "";
			position:absolute;
			bottom: -20rpx;
			width: 34rpx;
			height: 8rpx;
			border-radius: 8rpx;
			background: #ED861F;
		}
	}
}
.tab{
	margin-top: 45px!important;
	.tab-item{
		width: 50%;
		position:relative;
		font-size: 32rpx;
		&.active{
			color: #ED861F;
		}
		&.active::after{
			content: "";
			position:absolute;
			bottom: -20rpx;
			width: 40rpx;
			height: 10rpx;
			border-radius: 8rpx;
			background: #ED861F;
		}
	}
}
.content{
	border-radius: 20rpx;
	margin-bottom: 50rpx;
	margin-top: 94rpx;
	.daili-content{
		background: #fff;
		padding: 30rpx 20rpx!important;
		.typedaili1{
			width: 50%;
			.point{
				color: #ED861F;
				font-size: 70rpx;
				line-height: 30rpx;
			}
			.city-name{
				color:#333333;
			}
			.city-value{
				color:#000000;
				font-weight: bold;
			}
		}
		.typedaili2{
			width: 100%;
			padding-bottom:20rpx;
			&:last-child{
				padding-bottom:0rpx;
			}
			.point{
				color: #ED861F;
				font-size: 70rpx;
				line-height: 30rpx;
			}
			.city-name{
				color:#333333;
			}
			.city-value{
				color:#000000;
				font-weight: bold;
			}
		}
	}
	.group-fac{
		border-bottom:2rpx solid #F0F0F0 ;
		margin: 20rpx  0rpx 0;
		padding: 30rpx 40rpx;
		border-radius: 18rpx;
		width: 100%;
		.left-img{
			width: 260rpx;
			height: 160rpx;
			margin-right: 20rpx;
		}
		.leftgroup{
			font-weight: bold;
			font-size: 32rpx;
			color: #000000;
			line-height: 30rpx;
			.right{
				width:20rpx;
				height: 30rpx;
			}
		}
		.left-title{
			margin-top: 20rpx;
			font-weight: 500;
			font-size: 30rpx;
			color: #999;
			line-height: 42rpx;
		}
		.num{
			font-size: 24rpx;
			color:#ED861F;
			margin-left: 18rpx;
		}
	}
}
.bottom-group{
	position: fixed;
	bottom: 0;
	width: 100%;
	height: 80rpx;
	display: flex;
	justify-content: space-between;
	align-items: center;
	.bottom-btn{
		width: 50%;
		padding: 10rpx 14rpx;
		border-radius: 20rpx;
		background: #ADCD2C;
		color: #fff;
		&:last-child{
			background: #ED861F;
		}
		.btn-price{
			font-size: 24rpx;
		}
	}
	.bottom-btns{
		width: 100%;
		height: 90rpx;
		border-radius: 20rpx;
		background: #ED861F;
		color: #fff;
	}
}


</style>
